<?php
namespace Anls\Com\Indicator;

/**
 * 形态
 * @author w.
 *
 */
class Shape {

    /**
     * 上穿
     * 
     * @param array $bar
     * @param string $key1
     * @param string $key2
     * @param int $shift
     */
	public static function crossOver($bar,$key1,$key2,$shift){
		$rst = false;
		if($bar[$shift][$key1] > $bar[$shift][$key2]){
			$count = $shift-1;
			$con = $bar[$count][$key1] == $bar[$count][$key2];
			while($con && $count >= 0){
				$count = $count -1;
				$con = $bar[$count][$key1] == $bar[$count][$key2];
			}
			if($bar[$count][$key1] < $bar[$count][$key2] 
			    && ($bar[$count][$key1] != -1 && $bar[$count][$key2] != -1))
				$rst = true;
		} 
		return($rst);
	}
}

?>
